package cn.jdy.payment.entity;

import cn.jdy.common.bo.BaseEntry;
import cn.jdy.plugins.entity.Business;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;
import java.util.Map;


@Entity
public class Orders extends BaseEntry {

	private static final long serialVersionUID = 1L;

	//订单表字段区
	@Id
	@Column(length = 32)
	private String id;          //流水号（订单编号）
	private String userId;          //用户ID
	private String userName;          //用户名
	private String orderType;        //订单类型(1：购买商机；2：会员充值；3：退款)
	private String status;          //订单状态(1：支付成功；2：支付失败；3：撤销订单；4：未支付)
	private String amount;          //订单金额
	private String bankNo;          //银行编号
	private String outNo;          //外部流水
	private String curType;          //币种
	private String goodsNo;          //商品编号
	private String goodsNum;        //商品数量
	private String goodsName;        //商品名称
	private int sMoney;        //使用的S币数量
	private String orderDate;        //订单时间
	private String notifyDate;        //银行通知时间
	private String acctDate;        //账务时间
	private String operIp;          //用户IP
	private double exchange;          //汇率
	private String remark1;          //备注1
	private String remark2;          //备注2
	private String chargeStatus;          //销账状态

	@ManyToOne
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "goodsNo", insertable = false, updatable = false)
	private Business business; //商机

	//其他字段
	@Transient
	private String bankName;        //银行名称
	@Transient
	private String bankAddr;        //银行地址
	@Transient
	private String bankData;        //银行数据（参数或者返回数据）
	@Transient
	private Map<String, String> paraMap;  //提交银行参数map

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public double getExchange() {
		return exchange;
	}

	public void setExchange(double exchange) {
		this.exchange = exchange;
	}

	public String getGoodsName() {
		return goodsName;
	}

	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}

	public String getChargeStatus() {
		return chargeStatus;
	}

	public void setChargeStatus(String chargeStatus) {
		this.chargeStatus = chargeStatus;
	}

	public int getsMoney() {
		return sMoney;
	}

	public void setsMoney(int sMoney) {
		this.sMoney = sMoney;
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getOrderType() {
		return orderType;
	}

	public void setOrderType(String orderType) {
		this.orderType = orderType;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getAmount() {
		return amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}

	public String getBankNo() {
		return bankNo;
	}

	public void setBankNo(String bankNo) {
		this.bankNo = bankNo;
	}

	public String getOutNo() {
		return outNo;
	}

	public void setOutNo(String outNo) {
		this.outNo = outNo;
	}

	public String getCurType() {
		return curType;
	}

	public void setCurType(String curType) {
		this.curType = curType;
	}

	public String getGoodsNo() {
		return goodsNo;
	}

	public void setGoodsNo(String goodsNo) {
		this.goodsNo = goodsNo;
	}

	public String getGoodsNum() {
		return goodsNum;
	}

	public void setGoodsNum(String goodsNum) {
		this.goodsNum = goodsNum;
	}

	public String getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(String orderDate) {
		this.orderDate = orderDate;
	}

	public String getNotifyDate() {
		return notifyDate;
	}

	public void setNotifyDate(String notifyDate) {
		this.notifyDate = notifyDate;
	}

	public String getAcctDate() {
		return acctDate;
	}

	public void setAcctDate(String acctDate) {
		this.acctDate = acctDate;
	}

	public String getOperIp() {
		return operIp;
	}

	public void setOperIp(String operIp) {
		this.operIp = operIp;
	}

	public String getRemark1() {
		return remark1;
	}

	public void setRemark1(String remark1) {
		this.remark1 = remark1;
	}

	public String getRemark2() {
		return remark2;
	}

	public void setRemark2(String remark2) {
		this.remark2 = remark2;
	}

	public String getBankName() {
		return bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	public String getBankAddr() {
		return bankAddr;
	}

	public void setBankAddr(String bankAddr) {
		this.bankAddr = bankAddr;
	}

	public String getBankData() {
		return bankData;
	}

	public void setBankData(String bankData) {
		this.bankData = bankData;
	}

	public Map<String, String> getParaMap() {
		return paraMap;
	}

	public void setParaMap(Map<String, String> paraMap) {
		this.paraMap = paraMap;
	}

	public Business getBusiness() {
		return business;
	}

	public void setBusiness(Business business) {
		this.business = business;
	}
}
